/*
 Navicat Premium Data Transfer

 Source Server         : ali
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : 39.108.229.166:3306
 Source Schema         : employ_zhilu

 Target Server Type    : MySQL
 Target Server Version : 50728
 File Encoding         : 65001

 Date: 04/06/2020 15:06:21
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `title` varchar(100) NOT NULL COMMENT 'title of article',
  `status` tinyint(1) DEFAULT NULL,
  `keyword` varchar(100) DEFAULT NULL,
  `content` text COMMENT 'content of article',
  `create_date` datetime DEFAULT NULL COMMENT 'create_date of article',
  `edit_date` datetime DEFAULT NULL COMMENT 'edit_date of article',
  `outline_id` bigint(20) DEFAULT NULL,
  `rank` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `outline_id` (`outline_id`),
  CONSTRAINT `article_ibfk_1` FOREIGN KEY (`outline_id`) REFERENCES `outline` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of article
-- ----------------------------
BEGIN;
INSERT INTO `article` VALUES (1, '01 | 公司能装进财务报表里吗？', 1, '财务', '<p>公司能装进财务报表里吗？</p>\r\n', '2020-06-04 13:27:31', '2020-06-04 13:27:31', 2, 1);
INSERT INTO `article` VALUES (2, '02 | 资产边界：属于你的就是资产吗？', 1, NULL, '', '2020-06-04 14:32:54', '2020-06-04 14:32:54', 2, NULL);
INSERT INTO `article` VALUES (3, '03 | 资产配置：怎么看懂一家公司的经营战略？', 1, NULL, '', '2020-06-04 14:33:04', '2020-06-04 14:33:04', 2, NULL);
INSERT INTO `article` VALUES (4, '04 | 负债经营：高负债等于高风险吗？', 1, NULL, '', '2020-06-04 14:35:47', '2020-06-04 14:35:47', 2, NULL);
INSERT INTO `article` VALUES (5, '05 | 隐藏负债：怎么看透一家公司的债务风险？', 1, NULL, '', '2020-06-04 14:35:56', '2020-06-04 14:35:56', 2, NULL);
INSERT INTO `article` VALUES (6, '06 | 利润革命：近似的正确好过精确的错误', 1, NULL, '', '2020-06-04 14:36:02', '2020-06-04 14:36:02', 2, NULL);
INSERT INTO `article` VALUES (7, '07 | 利润质量：可持续利润最可贵', 1, NULL, '', '2020-06-04 14:36:09', '2020-06-04 14:36:09', 2, NULL);
INSERT INTO `article` VALUES (8, '08 | 现金水平：手里的钱是越多越好吗？', 1, NULL, '', '2020-06-04 14:36:22', '2020-06-04 14:36:22', 2, NULL);
INSERT INTO `article` VALUES (9, '09 | 现金结构：现金流为负，为何还能上市？', 1, NULL, '', '2020-06-04 14:36:34', '2020-06-04 14:36:34', 2, NULL);
INSERT INTO `article` VALUES (10, '10 | 财报实战：凡有表象，必有秘藏', 1, NULL, '', '2020-06-04 14:36:41', '2020-06-04 14:36:41', 2, NULL);
INSERT INTO `article` VALUES (11, '11 | 财报分析：如何识别财务造假?', 1, NULL, '', '2020-06-04 14:36:57', '2020-06-04 14:36:57', 2, NULL);
INSERT INTO `article` VALUES (12, '12 | 报表附注：字越小越重要', 1, NULL, '', '2020-06-04 14:37:02', '2020-06-04 14:37:02', 2, NULL);
INSERT INTO `article` VALUES (13, '发刊词 | 从此成为一个懂财务的人', 1, NULL, '', '2020-06-04 14:47:19', '2020-06-04 14:47:19', 1, NULL);
INSERT INTO `article` VALUES (14, '14 | 融资原则：“匹配”的双重维度', 1, NULL, '', '2020-06-04 14:47:44', '2020-06-04 14:47:44', 3, NULL);
INSERT INTO `article` VALUES (15, '15 | 融资关系：债权人和股东的制衡之道', 1, NULL, '', '2020-06-04 14:47:53', '2020-06-04 14:47:53', 3, NULL);
INSERT INTO `article` VALUES (16, '16 | 股权结构：怎么融资能保住控制权？', 1, NULL, '<p>16 | 股权结构：怎么融资能保住控制权？</p>\r\n', '2020-06-04 14:57:06', '2020-06-04 14:57:06', 3, NULL);
COMMIT;

-- ----------------------------
-- Table structure for course
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `loginId` bigint(20) DEFAULT NULL,
  `courseName` varchar(20) DEFAULT NULL COMMENT '课程名字',
  `coursePrice` float DEFAULT NULL COMMENT '课程价格',
  `description` text COMMENT '课程说明',
  `url` varchar(100) DEFAULT NULL COMMENT '课程地址',
  `create_date` datetime DEFAULT NULL,
  `status` varchar(1) DEFAULT NULL,
  `subhead` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `loginId` (`loginId`),
  CONSTRAINT `course_ibfk_1` FOREIGN KEY (`loginId`) REFERENCES `user` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of course
-- ----------------------------
BEGIN;
INSERT INTO `course` VALUES (3, 1, '财务管理', 99, '<p>1.稻盛和夫说：&ldquo;不懂财务，不能成为真正的经营者。&rdquo;从这门课开始，懂它。</p>\r\n\r\n<p>2.在这门课里，财务不仅是一门专业，还是理解公司的一种&ldquo;语法&rdquo;。</p>\r\n\r\n<p>3.不论是求职、投资还是找合作伙伴，这门课能帮你看懂一家公司。</p>\r\n\r\n<p>4.你将得到：40讲课程内容、五大思维方式（投资回报思维、风险控制思维、量化分析与管理思维、业务思维、战略思维）、20多个中国A股真实案例。</p>\r\n\r\n<p>5.用音频就能讲清楚会计课，这是贾宁老师非常成功的一次探索。</p>\r\n', NULL, '2020-06-04 10:17:01', '1', '从此成为一个懂财务的人');
COMMIT;

-- ----------------------------
-- Table structure for outline
-- ----------------------------
DROP TABLE IF EXISTS `outline`;
CREATE TABLE `outline` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `courseId` bigint(20) DEFAULT NULL,
  `outlineName` varchar(40) DEFAULT NULL COMMENT '大纲名字',
  `outlineRank` float DEFAULT NULL COMMENT '大纲排序',
  `isHeader` tinyint(1) DEFAULT NULL COMMENT '是否为父级节点',
  `remark` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `courseId` (`courseId`),
  CONSTRAINT `outline_ibfk_1` FOREIGN KEY (`courseId`) REFERENCES `course` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of outline
-- ----------------------------
BEGIN;
INSERT INTO `outline` VALUES (1, 3, '发刊词', 2, 0, '');
INSERT INTO `outline` VALUES (2, 3, '第一模块 | 表征：呈现公司经营活动(13讲)', 0, 0, '财报是公司经营活动的记录、量化和呈现，掌握财务思维的第一步是看清一家公司的真实状况。');
INSERT INTO `outline` VALUES (3, 3, '第二模块 | 找钱：融资与管理', 2, 0, '带你通过CEO的视角，看清融资和管理的财务逻辑，掌握资源配置的核心原则。');
INSERT INTO `outline` VALUES (4, 3, '第三模块 | 花钱：投资与分配', 3, 0, '帮你剥离干扰，理解投资和分配背后的真实考量，学到财务高手的决策思维。');
INSERT INTO `outline` VALUES (5, 3, '加餐', 4, 0, '不定期为你分享新知。');
COMMIT;

-- ----------------------------
-- Table structure for role
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(80) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `permission` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of role
-- ----------------------------
BEGIN;
INSERT INTO `role` VALUES (1, 'admin', 'admin', 'admin');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(20) DEFAULT NULL COMMENT '用户姓名',
  `loginame` varchar(20) DEFAULT NULL COMMENT '用户登录名',
  `password` varchar(255) DEFAULT NULL COMMENT '密码',
  `email` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `last_login_at` datetime DEFAULT NULL COMMENT '最后一次登录的时间',
  `current_login_at` datetime DEFAULT NULL COMMENT '最近一次登录的时间',
  `last_login_ip` varchar(20) DEFAULT NULL COMMENT '最后一次登录的ip',
  `current_login_ip` varchar(20) DEFAULT NULL,
  `login_count` int(11) DEFAULT NULL COMMENT '登录次数',
  `active` tinyint(1) DEFAULT NULL COMMENT '状态码',
  `confirmed_at` datetime DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1, 'zxjsama', 'zxjsama', '$2b$12$HwzLynG4ws272/uJaoAGwep3yy1uksLMYMPjPzq7RmujlvrTnbNaC', 'zxjlm233@163.com', '2020-04-11 05:05:21', '2020-06-04 06:56:16', '127.0.0.1', '127.0.0.1', 5, 1, '2020-03-15 10:53:13', '清华大学经管学院会计系博士生导师');
COMMIT;

-- ----------------------------
-- Table structure for user_role
-- ----------------------------
DROP TABLE IF EXISTS `user_role`;
CREATE TABLE `user_role` (
  `user_id` bigint(20) DEFAULT NULL,
  `role_id` bigint(20) DEFAULT NULL,
  KEY `user_id` (`user_id`),
  KEY `role_id` (`role_id`),
  CONSTRAINT `user_role_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_role_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of user_role
-- ----------------------------
BEGIN;
INSERT INTO `user_role` VALUES (1, 1);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
